package org.joint.validate;

/**
 *
 * @author atila camurca
 */
public class NumericField {

   public static boolean isNumeric(int keyCode, String value) {
      if ((isInNumericRange(keyCode)) || keyCode == 44) {
         if (!(keyCode == 44 && value.contains(","))) {
            return true;
         }
      }
      return false;
   }

   public static boolean isInNumericRange(int keyCode) {
      if ((keyCode > 47 && keyCode < 58) || keyCode == 44) {
         return true;
      }
      return false;
   }
}
